<?php
/**
 *
 * @author Quentin Laujac, Charles Hurtevent
 *
 */
require_once ("../enums/enums.php");
require_once ("../bean/data/Article.php");
require_once ("../bean/data/Commande.php");
require_once ("../bean/data/Facture.php");
require_once ("../bean/data/Utilisateur.php");
require_once ("../services/ClientService.php");

// si le formulaire est envoye
if($_POST) {
	session_start();
	$clientService = new ClientService();

	$client = $_SESSION ['login'];
	$listCommande = $clientService->getHistoriqueCommande ( $client );
	$commande =  $listCommande[$_POST['numCommande']];
	$clientService->annulerCommande($commande);

	//redirection
	header('Location: ../action/clientEditerCommandeAction.php');
	exit();
}
